<!doctype html>
<html lang="en">
<head>
{{template "common_header.html" .}}
</head>
<body class="login-bg">

<div class="login layui-anim layui-anim-up">
    <div class="message">Ageis Passport登录中心</div>
    <div id="darkbannerwrap"></div>

    <form method="post" id="doc-login-form" class="layui-form" onsubmit="return false">
        <input type="hidden" name="key" value="{{.key}}"/>
        <input type="hidden" id="auth_back_url" name="auth_back_url" value="{{.auth_back_url}}"/>
        <input type="text" name="account" placeholder="账号" lay-verify="required" class="layui-input" >
        <hr class="hr15">
        <input type="password" name="password" placeholder="密码" lay-verify="required" class="layui-input">
        <hr class="hr15">
        <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit" id="login-btn">
        <hr class="hr20" >
    </form>
</div>
{{template "common_js.html" .}}
<script>
    $(function  () {
        $('#login-btn').on('click', function () {
            var data = $('#doc-login-form').serialize();
            var url = '/ssoDoLogin';
            $.post(url, data, function(resp){
                if(resp.en == 200) {
                    layer.msg(resp.em);
                    setTimeout(function(){
                        window.location.href = resp.data.redirect_url;
                    },1000);
                } else {
                    layer.msg(resp.em);
                }
            });
        });

    });
</script>

</body>
</html>